package com.avantis.common.repository;

import com.avantis.common.entity.Permission;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

/**
 * @ClassName PermissionRepository
 * @Description TODO
 * @Author kirago
 * @Date 2018/11/26 19:31
 * @Version 1.0
 **/
@Repository
@CacheConfig(cacheNames = "permissions")
public interface PermissionRepository extends JpaRepository<Permission,Integer> {

	Optional<Permission> findById(Integer integer);

	@Cacheable
	List<Permission> findAll();
}
